﻿using System;
using System.Web.UI.WebControls;
using BLL.RF.TestRecord;

public partial class ViewbyProduct_View_ATEFlowControlCheckData_ATEFlowControlCheck_ViewbyDT : System.Web.UI.Page
{
    private Action_Record ar;

    public ViewbyProduct_View_ATEFlowControlCheckData_ATEFlowControlCheck_ViewbyDT()
    {
        ar = new Action_Record();
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindData();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        BindData();
    }

    private void BindData()
    {
        DateTime dt1 = DateTime.Parse(this.TextBox1.Value.Trim());
        DateTime dt2 = DateTime.Parse(this.TextBox2.Value.Trim());
        this.GridView1.DataSource = ar.Action_Record_GetATEFlowControlCheck_byDT(dt1, dt2);
        this.GridView1.DataBind();
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            if (GridView1.Rows[i].Cells[5].Text == "Fail")
                GridView1.Rows[i].Cells[5].ForeColor = System.Drawing.Color.Red;
        }
    }
}
